1. Field of Invention
The invention relates to a method and apparatus for overloading operators in Page-Description-Language (PDL) defined images to adjust widths of lines or other image attributes in a manner that yields preferred line widths or compensates for marking characteristics of a target printer or display device. More specifically, line width can be controlled based on various attributes, such as color, size, width, pattern or orientation. Line width can also be controlled to compensate for fill in of reverse-line and "cookie-cutter" holes.
2. Description of Related Art
In a network or single personal computer environment, a user may create a job representing a page to be printed having one or more sections of text, graphics and photos. Alternatively, a job may be scanned in or copied from an existing file. This job is encoded into a page description language, such as Postscript.RTM., a trademark of Adobe Systems Inc., and sent to a printer driver for printing by a printer or other marking system or displayed on a display system, such as a monitor. Other page description languages exist, or may be developed in the coming years, and the inventive overloaded method to apply "line drawing" operators can be used in any relevant computer language or control code.
Postscript.RTM. is a programming language optimized for printing graphics or text. It provides a convenient language in which to describe images in a device independent manner. That is, the same code is used regardless of the printer or output device. Postscript.RTM. is a stack-based interpreted language. In Postscript.RTM., you push operands onto an operand stack by naming them and then you invoke the operator to use them.
A "def" operator enters a definition into a top-most dictionary on a dictionary stack. The top operand on the operand stack is the value, and the operand below the value is the key. The "def" operator can also define new operators. An important result of a Postscript.RTM. defined image is that the elements in the procedure that describe an image are not evaluated until the procedure is invoked. Also, each operator has to be looked up each time the procedure is invoked. Unless a bind is used, evaluation of procedure components is delayed and the definition of an operator used in a procedure is the one in effect when the procedure is run, not when it was defined.
To define an image in Postscript.RTM., the image is described by a path, which is a collection of connected or disjointed line segments and curves arranged on a page. The path does not actually describe actual ink on the paper, but rather describes an imaginary tracing over the page. Various operators allow a user to draw ink along the path, using the "stroke" operator, fill an enclosed path with ink, using the "fill" operator, or setting a paint region, using the "clip" operator.
A path is started with the "newpath" operator. The path is constructed out of line segments and curves. For simplicity, an exemplary square can be defined in Postscript.RTM. using the "moveto" operator, which defines a start point of the path, and the "lineto" operator, which adds line segments sequentially around the four comers of the square. Alternatively, a "closepath" operator can be used to close up the path with a smallest possible line segment, which in the case of a square object results in the same object path as using four "lineto" operators.
Once the path is defined, it can be drawn with the "stroke" operator. The "stroke" operator draws the image by following the path. The look of the stroke can be adjusted by another operator "setlinewidth". The "setlinewidth" operator sets the width of all lines to be stroked (drawn) to a value specified in points. In Postscript.RTM., a point equals 1/72 of an inch. The "setlinewidth" operator takes a single numerical argument, which is the width expressed in points, and affects all lines stroked after the "stroke" operator is invoked. The "setlinewidth" operator affects the markings placed on a page after it is called and does not affect the path until the path has been stroked or filled. As such, you cannot set the width for one part of the path and then change it to another since the path is only drawn once. The "stroke" operator is also affected by the current ink pen color, current dash pattern and other settings.
Filling a shape is achieved by creating a path as before. However, instead of calling the "stroke" operator, the "fill" operator is invoked. The "fill" operator fills the inside or outside of a closed path using current ink settings.
Typical interpreters, such as the Adobe Postscript Raster Image Processor, process data from the PDL data for subsequent printing by the printer. PDL interpreters can exist either within the printer, such as a laser printer, or can reside at an image data source, such as a personal computer or server. However, there are many instances when such conventional interpreters or other decomposing devices decompose PDL images and the resultant printed image does not portray the intended image as desired, either due to marking characteristics of the printing device or as a result of the decomposition, or due to user preference.